﻿<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:ribbon="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon"
    xmlns:classic="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
    xmlns:rp="clr-namespace:Microsoft.Windows.Controls.Ribbon.Primitives;assembly=RibbonControlsLibrary"
    xmlns:Shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell" mc:Ignorable="d"
    xmlns:ws="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
    x:Class="WebsiteLoadTool.App"
    StartupUri="MainView.xaml">

    <Application.Resources>
    	<ResourceDictionary>
    		<BorderGapMaskConverter x:Key="BorderGapMaskConverter"/>
    		<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    		<Style TargetType="{x:Type ribbon:Ribbon}">
    			<Setter Property="Background" Value="#FFF1F3F7"/>
    			<Setter Property="BorderBrush" Value="#FF8B9097"/>
    			<Setter Property="Template">
    				<Setter.Value>
    					<ControlTemplate TargetType="{x:Type ribbon:Ribbon}">
    						<Grid SnapsToDevicePixels="True">
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="Auto"/>
    								<ColumnDefinition Width="*"/>
    								<ColumnDefinition Width="Auto"/>
    							</Grid.ColumnDefinitions>
    							<Grid.RowDefinitions>
    								<RowDefinition Height="Auto"/>
    								<RowDefinition Height="Auto"/>
    								<RowDefinition Height="Auto"/>
    								<RowDefinition Height="Auto"/>
    							</Grid.RowDefinitions>
    							<Border x:Name="BackgroundBorder" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Grid.ColumnSpan="3" Grid.Row="1" Grid.RowSpan="3"/>
    							<ContentControl x:Name="mainItemsPresenterHost" Grid.ColumnSpan="3" Focusable="False" Grid.Row="2" Visibility="Collapsed"/>
    							<Border Grid.ColumnSpan="3" Grid.Row="1">
    								<Popup x:Name="PART_ITEMSPRESENTERPOPUP" AllowsTransparency="True" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
    									<classic:SystemDropShadowChrome x:Name="Shdw" Color="Transparent" RenderOptions.ClearTypeHint="Enabled" FocusVisualStyle="{x:Null}" Focusable="True" Margin="0,0,5,5">
    										<Border x:Name="CollapsedPopupBackgroundBorder" Background="{TemplateBinding Background}">
    											<ContentControl x:Name="popupItemsPresenterHost" KeyboardNavigation.DirectionalNavigation="Cycle" Focusable="False" KeyboardNavigation.TabNavigation="Cycle">
    												<Border x:Name="groupsBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" Height="91" SnapsToDevicePixels="True">
    													<Border.Background>
    														<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    															<GradientStop Color="#EEFFFFFF" Offset="0"/>
    															<GradientStop Color="#BBFFFFFF" Offset="0.1"/>
    															<GradientStop Color="#05FFFFFF" Offset="0.5"/>
    															<GradientStop Color="#20FFFFFF" Offset="1"/>
    														</LinearGradientBrush>
    													</Border.Background>
    													<Border BorderBrush="#60FFFFFF" BorderThickness="0,0,0,1" Margin="0,0,0,1" SnapsToDevicePixels="True">
    														<ItemsPresenter x:Name="ItemsPresenter"/>
    													</Border>
    												</Border>
    											</ContentControl>
    										</Border>
    									</classic:SystemDropShadowChrome>
    								</Popup>
    							</Border>
    							<Border x:Name="QatBottomHost" Grid.ColumnSpan="3" Grid.Row="3" Background="#FFC2C6CA" Padding="0,3,0,0">
    								<Border Background="#FFD5D9DE" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,0">
    									<ContentPresenter x:Name="QatBottomHostContentPresenter" HorizontalAlignment="Left" IsHitTestVisible="True" VerticalAlignment="Center" Margin="0,2,0,4"/>
    								</Border>
    							</Border>
    							<Border x:Name="titleBarBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,0,1" Grid.ColumnSpan="3" Visibility="Collapsed">
    								<Border.Background>
    									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    										<GradientStop Color="#EEFFFFFF" Offset="0"/>
    										<GradientStop Color="#BBFFFFFF" Offset="0.1"/>
    										<GradientStop Color="#05FFFFFF" Offset="0.5"/>
    										<GradientStop Color="#20FFFFFF" Offset="1"/>
    									</LinearGradientBrush>
    								</Border.Background>
    							</Border>
    							<DockPanel Grid.ColumnSpan="3" Grid.Column="0" Height="{Binding WindowCaptionHeight, Source={x:Static ws:SystemParameters2.Current}}" LastChildFill="True">
    								<ContentControl x:Name="windowButtonPlaceHolder" DockPanel.Dock="Right" Focusable="False" IsHitTestVisible="False" Margin="3,0,0,0" Width="{Binding WindowCaptionButtonsLocation.Width, Source={x:Static ws:SystemParameters2.Current}}" Visibility="{TemplateBinding IsHostedInRibbonWindow, Converter={StaticResource BooleanToVisibilityConverter}}"/>
    								<ContentControl x:Name="windowIconPadding" DockPanel.Dock="Left" Focusable="False" IsHitTestVisible="False" Margin="0,0,3,0" Width="{Binding SmallIconSize.Width, Source={x:Static ws:SystemParameters2.Current}}"/>
    								<rp:RibbonTitlePanel x:Name="PART_TitlePanel">
    									<Grid x:Name="QatTopHost">
    										<Grid.ColumnDefinitions>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="*"/>
    											<ColumnDefinition Width="Auto"/>
    										</Grid.ColumnDefinitions>
    										<Border x:Name="QatTopHostLeftBorder" BorderBrush="#66CCCCCC" BorderThickness="1,0,1,0.9" Background="#77222222" Grid.Column="0" CornerRadius="0,0,2,2" Margin="8,2,0,2" Width="3"/>
    										<ContentPresenter x:Name="QatTopHostContentPresenter" Content="{TemplateBinding QuickAccessToolBar}" Grid.Column="1" IsHitTestVisible="True"/>
    										<Border x:Name="QatTopHostRightBorder" BorderBrush="#66CCCCCC" BorderThickness="1,0,1,0.9" Background="#77222222" Grid.Column="2" CornerRadius="0,0,2,2" Margin="0,2,1,2" Width="3"/>
    									</Grid>
    									<ContentPresenter x:Name="PART_TitleHost"
    										ContentSource="Title"
    										ContentTemplate="{TemplateBinding TitleTemplate}" 
    										TextBlock.FontSize="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}"
    										TextBlock.FontFamily="{DynamicResource {x:Static SystemFonts.CaptionFontFamilyKey}}"
    										TextBlock.FontWeight="{DynamicResource {x:Static SystemFonts.CaptionFontWeightKey}}"
    										TextElement.Foreground="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}"
    										HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
    										Margin="3,0"
    										MinHeight="{Binding WindowCaptionHeight, Source={x:Static ws:SystemParameters2.Current}}"
    										MinWidth="75"
    										IsHitTestVisible="False">
    										<ContentPresenter.Resources>
    											<!-- Glowing effect around Title in Aero glass theme -->
    											<DataTemplate DataType="{x:Type system:String}">
    												<TextBlock x:Name="titleTextBlock" 
    													Margin="0,-2,0,0"
    													Text="{TemplateBinding Content}"
    													TextTrimming="CharacterEllipsis"
    													HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
    												<DataTemplate.Triggers>
    													<MultiDataTrigger>
    														<MultiDataTrigger.Conditions>
    															<Condition Binding="{Binding IsGlassEnabled, Source={x:Static ws:SystemParameters2.Current}}" Value="True"/>
    															<Condition Binding="{Binding IsHostedInRibbonWindow, RelativeSource={RelativeSource AncestorType={x:Type ribbon:Ribbon}, Mode=FindAncestor}}" Value="True" />
    														</MultiDataTrigger.Conditions>
    														<Setter TargetName="titleTextBlock" Property="Effect">
    															<Setter.Value>
    																<DropShadowEffect Color="White" BlurRadius="5.0" ShadowDepth="0"/>
    															</Setter.Value>
    														</Setter>
    													</MultiDataTrigger>
    													<DataTrigger Binding="{Binding IsGlassEnabled, Source={x:Static ws:SystemParameters2.Current}}" Value="False">
    														<Setter TargetName="titleTextBlock" Property="Margin" Value="0" />
    														<Setter TargetName="titleTextBlock" Property="VerticalAlignment" Value="Center" />
    													</DataTrigger>
    													<DataTrigger Binding="{Binding HighContrast, Source={x:Static ws:SystemParameters2.Current}}" Value="True">
    														<Setter TargetName="titleTextBlock" Property="Margin" Value="0,1,0,0" />
    													</DataTrigger>
    													<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType={x:Type ribbon:RibbonWindow}, Mode=FindAncestor}}" Value="Maximized">
    														<Setter TargetName="titleTextBlock" Property="Margin" Value="0,2,0,0" />
    													</DataTrigger>
    												</DataTemplate.Triggers>
    											</DataTemplate>
    										</ContentPresenter.Resources>
    									</ContentPresenter>
    									<ribbon:RibbonContextualTabGroupItemsControl x:Name="PART_ContextualTabGroupItemsControl" HorizontalAlignment="Center" IsHitTestVisible="True" ws:WindowChrome.IsHitTestVisibleInChrome="True"/>
    								</rp:RibbonTitlePanel>
    							</DockPanel>
    							<ContentPresenter x:Name="applicationMenu" Content="{TemplateBinding ApplicationMenu}" Grid.Row="1" VerticalAlignment="Bottom"/>
    							<ribbon:RibbonTabHeaderItemsControl x:Name="TabHeaderItemsControl" Grid.Column="1" HorizontalAlignment="Left" Margin="1,1,1,0" Grid.Row="1" VerticalAlignment="Bottom"/>
    							<ContentPresenter x:Name="PART_HelpPane" ContentTemplate="{TemplateBinding HelpPaneContentTemplate}" Content="{TemplateBinding HelpPaneContent}" Grid.Column="2" ContentSource="HelpPaneContent" HorizontalAlignment="Right" Grid.Row="1" VerticalAlignment="Top"/>
    						</Grid>
    						<ControlTemplate.Triggers>
    							<Trigger Property="IsCollapsed" Value="true">
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="applicationMenu"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="QatBottomHost"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="QatTopHost"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="mainItemsPresenterHost"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="TabHeaderItemsControl"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="PART_HelpPane"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="PART_ContextualTabGroupItemsControl" />
    								<Setter Property="MinWidth" Value="0" TargetName="PART_TitleHost" />
    							</Trigger>
    							<MultiTrigger>
    								<MultiTrigger.Conditions>
    									<Condition Property="IsCollapsed" Value="True" />
    									<Condition Property="IsHostedInRibbonWindow" Value="False" />
    								</MultiTrigger.Conditions>
    								<Setter Property="Visibility" Value="Collapsed"/>
    							</MultiTrigger>
    							<Trigger Property="ShowQuickAccessToolBarOnTop" Value="false">
    								<Setter Property="Content"  Value="{x:Null}" TargetName="QatTopHostContentPresenter"/>
    								<Setter Property="Visibility"  Value="Collapsed" TargetName="QatTopHost"/>
    								<Setter Property="Content"  Value="{Binding QuickAccessToolBar, RelativeSource={RelativeSource TemplatedParent}}" TargetName="QatBottomHostContentPresenter"/>
    							</Trigger>
    							<Trigger Property="ShowQuickAccessToolBarOnTop" Value="True">
    								<Setter Property="Visibility" TargetName="QatBottomHost" Value="Collapsed"/>
    							</Trigger>
    							<MultiDataTrigger>
    								<MultiDataTrigger.Conditions>
    									<Condition Binding="{Binding QuickAccessToolBar.HasItems, RelativeSource={RelativeSource Self}}" Value="False"/>
    									<Condition Binding="{Binding QuickAccessToolBar.CustomizeMenuButton, RelativeSource={RelativeSource Self}}" Value="{x:Null}"/>
    								</MultiDataTrigger.Conditions>
    								<Setter Property="Visibility" Value="Collapsed" TargetName="QatTopHost"/>
    								<Setter Property="Visibility" Value="Collapsed" TargetName="QatBottomHost"/>
    							</MultiDataTrigger>
    							<Trigger Property="IsMinimized" Value="True">
    								<Setter Property="Padding" TargetName="QatBottomHost" Value="0"/>
    							</Trigger>
    							<Trigger Property="IsMinimized" Value="False">
    								<Setter Property="Visibility"  Value="Visible" TargetName="mainItemsPresenterHost"/>
    								<Setter Property="Content"  Value="{x:Null}" TargetName="popupItemsPresenterHost"/>
    								<Setter Property="Content"  Value="{Binding ElementName=groupsBorder}" TargetName="mainItemsPresenterHost"/>
    							</Trigger>
    							<Trigger Property="WindowIconVisibility" Value="Collapsed">
    								<Setter Property="Visibility" Value="Collapsed" TargetName="windowIconPadding"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="Visibility" Value="Collapsed"/>
    							</Trigger>
    							<Trigger Property="IsHostedInRibbonWindow" Value="False">
    								<Setter TargetName="BackgroundBorder" Property="Grid.Row" Value="0" />
    								<Setter TargetName="BackgroundBorder" Property="Grid.RowSpan" Value="4" />
    								<Setter TargetName="titleBarBackground" Property="Visibility" Value="Visible" />
    								<Setter TargetName="windowIconPadding" Property="Visibility" Value="Collapsed"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="Visibility" Value="Collapsed"/>
    							</Trigger>
    							<Trigger SourceName="PART_ITEMSPRESENTERPOPUP" Property="HasDropShadow" Value="true">
    								<Setter TargetName="Shdw" Property="Color" Value="#71000000"/>
    							</Trigger>
    							<MultiDataTrigger>
    								<MultiDataTrigger.Conditions>
    									<Condition Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType={x:Type ribbon:RibbonWindow}, Mode=FindAncestor}}" Value="False"/>
    									<Condition Binding="{Binding IsGlassEnabled, Source={x:Static ws:SystemParameters2.Current}}" Value="False"/>
    									<Condition Binding="{Binding IsHostedInRibbonWindow, RelativeSource={RelativeSource Self}}" Value="True" />
    								</MultiDataTrigger.Conditions>
    								<Setter TargetName="PART_TitleHost" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveCaptionTextBrushKey}}" />
    							</MultiDataTrigger>

    							<DataTrigger Binding="{Binding HighContrast, Source={x:Static ws:SystemParameters2.Current}}" Value="True">
    								<Setter TargetName="BackgroundBorder" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
    								<Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
    								<Setter TargetName="groupsBorder" Property="Background" Value="Transparent"/>
    								<Setter TargetName="groupsBorder" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
    								<Setter TargetName="groupsBorder" Property="Height" Value="94"/>
    								<Setter TargetName="QatBottomHost" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
    								<Setter TargetName="titleBarBackground" Property="Background" Value="Transparent"/>
    								<Setter TargetName="titleBarBackground" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
    								<Setter TargetName="CollapsedPopupBackgroundBorder" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
    								<Setter TargetName="PART_ITEMSPRESENTERPOPUP" Property="PopupAnimation" Value="None" />
    								<Setter TargetName="QatTopHostLeftBorder" Property="Margin" Value="10,1,2,2"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="Width" Value="1"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="BorderThickness" Value="0"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="CornerRadius" Value="0"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="Margin" Value="0,1,2,2"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="Width" Value="1"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="BorderThickness" Value="0"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="CornerRadius" Value="0"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
    							</DataTrigger>

    							<!-- The Title & separators that surround the QAT are drawn slightly differently in Aero. -->
    							<DataTrigger Binding="{Binding UxThemeName, Source={x:Static ws:SystemParameters2.Current}}" Value="Aero">
    								<Setter TargetName="QatTopHost" Property="Margin" Value="0,-3,0,0"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="Margin" Value="3,3,0,5"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="Background" Value="#81444444"/>
    								<Setter TargetName="QatTopHostLeftBorder" Property="BorderBrush" Value="#69EEEEEE"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="Margin" Value="0,3,1,5"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="Background" Value="#81444444"/>
    								<Setter TargetName="QatTopHostRightBorder" Property="BorderBrush" Value="#69EEEEEE"/>
    							</DataTrigger>
    							<MultiDataTrigger>
    								<MultiDataTrigger.Conditions>
    									<Condition Binding="{Binding UxThemeName, Source={x:Static ws:SystemParameters2.Current}}" Value="Aero"/>
    									<Condition Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType={x:Type ribbon:RibbonWindow}, Mode=FindAncestor}}" Value="Maximized"/>
    								</MultiDataTrigger.Conditions>
    								<Setter TargetName="QatTopHost" Property="Margin" Value="0"/>
    							</MultiDataTrigger>
    						</ControlTemplate.Triggers>
    					</ControlTemplate>
    				</Setter.Value>
    			</Setter>
    		</Style>

    		<Style TargetType="{x:Type DataGrid}">
    			<Setter Property="Background" Value="#FFFAFAFA"/>
    			<Setter Property="RowBackground" Value="#FFF4F5F9" />
    			<Setter Property="VerticalGridLinesBrush" Value="#FFF0F0F0" />
    			<Setter Property="HorizontalGridLinesBrush" Value="LightGray" />
    			<Setter Property="GridLinesVisibility" Value="Horizontal" />
    			<Setter Property="HeadersVisibility" Value="Column" />
    			<Setter Property="CanUserAddRows" Value="False" />
    			<Setter Property="CanUserDeleteRows" Value="False" />
    			<Setter Property="CanUserResizeRows" Value="False" />
    			<Setter Property="SelectionMode" Value="Single" />
    			<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
    			<Style.Triggers>
    				<Trigger Property="Validation.HasError" Value="True">
    					<Setter Property="ToolTip" Value="{Binding (Validation.Errors)[0].ErrorContent, RelativeSource={x:Static RelativeSource.Self}}" />
    				</Trigger>
    			</Style.Triggers>
    		</Style>

    	</ResourceDictionary>

    </Application.Resources>

</Application>
